package com.example.demo.dao;

import com.example.demo.model.UserInfo;
import com.example.demo.model.vo.UserInfoVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: wenjingyuan
 * @Date: 2023/08/01/10:59
 * @Description:
 */
public interface UserMapper {
    @Insert("insert into userinfo(username,password) values(#{username},#{password})")
    int reg(UserInfo userInfo);

    @Select("select * from userinfo where username=#{username}")
    UserInfo getUserByName(@Param("username") String username);

    @Select("select username from userinfo where id>0")
    List<String> getUsername();

    @Select("select * from userinfo where id=#{uid}")
    UserInfoVO getUserDetail(@Param("uid")int uid);
}
